//
//  XAFoundViewController.swift
//  DemoNavBar
//
//  Created by YangHuan on 2019/12/16.
//  Copyright © 2019 YangHuan. All rights reserved.
//

import UIKit

class XAFoundViewController: BaseViewController {
    
    var imageView: UIImageView?
    let systemTool = CLLSystemTool()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        setVVVView()
        navigationItem.title = "发现"
       setImageWithColorNavigation(image: getImageWithColor(color: UIColor("#2893FE")!))
        
        
        imageView = UIImageView(frame: CGRect.init(x: 180, y: 200, width: 100, height: 100))
        view.addSubview(imageView!)
        imageView?.image = UIImage(named: "ssss")
        weak var weakSelf = self // 弱引用
        systemTool.selectedImageBlock = { (image) in
            weakSelf?.imageView?.image = image
            
        }
        
        
          let btn = UIButton.init(frame: CGRect.init(x: 100, y: 100, width: 50, height: 50 ))
            btn.backgroundColor = UIColor.red
            btn.addTarget(self, action: #selector(ShouYeviewcontroller.Shengji), for: .touchUpInside)
            self.view.addSubview(btn)
        }
    
    
        @objc func Shengji(){
            systemTool.showPromptBox()
//            let vc = oneViewController()
//            self.navigationController?.pushViewController(vc, animated: true)
        }
        
    
    deinit {
       
        DLog("====ddd===\(self)====")
    }
   

}
extension XAFoundViewController {
    func  setVVVView()  {
        let label = UILabel.init(frame: CGRect.init(x: 30, y: 350, width: UIScreen.main.bounds.size.width - 60, height: 40))
        label.textColor = UIColor.black
        label.font = UIFont.systemFont(ofSize: 14)
        view.addSubview(label)
        label.attributedText = NSAttributedString.init().changeFontColor(totalString: "我是14号字体黑色我是17号加粗字体红色", subString: "我是17号加粗字体红色", font: UIFont.systemFont(ofSize: 17, weight: .bold), textColor: UIColor.red)
        
        
        
        
    }
}
